package day240407;

import java.util.Scanner;

//练习：数值拆分
//输入一个三位数，将其拆分为个位、十位、百位
public class exercise1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个三位数");
        int d = sc.nextInt();
        int a = d % 10;
        int b = d / 10 % 10;
        int c = d / 100 % 10;
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
    }
}
//公式总结：
//数值 /10n % 10